<template>
  <div class="container" style="width:99%;">
    <div>
      <el-input placeholder="请输入名称" v-model="message"></el-input>
      <button @click="clickBtn">查询</button>
    </div>
  </div>
</template>

<script>
import Card from "../components/Card";
import AppButton from "../components/AppButton";

export default {
  name: "NameRepeat",
  components: {
    Card,
    AppButton,

  },
  data() {
    return {
      cardList: [],
      page: {
        pageNum: 1,
        pageSize: 10
      },
      message:''
    };
  },
  methods: {
    clickBtn(){
      this.$api.school.querySchools({name:this.message}).then(res=>{
         if(res.result==1){
          this.$message({
            message:'查询成功',
            type: "success"
          });
          this.$api.dropdown.deptLevel3().then(res2=>{
            if(res2.result==1){
              res.schoolsQuerys.forEach(v=>{
                res2.departmentInfoList.forEach(j=>{
                  if(v.thirdLevelDepartment==j.id){
                    v.thirdLevelDepartment=j.deptName
                  }
                })
              })
              if(res.schoolsQuerys.length==0){
                this.$message({
                    message:'无此学校名',
                    type: "success"
                });
              }
            }else{
              this.$message({
                message:'获取部门数据失败',
                type: "error"
              });
            }
          })
          this.tableData=res.schoolsQuerys
          this.checkloading=false
          this.askingforShow=false
          this.isLoadingSuccess=true
        }else{
          this.$message({
            message: res.msg,
            type: "error"
          });
          this.checkloading=false
          this.isLoadingSuccess=false
        }
      })
    }
  },
  mounted() {
   
  }
};
</script>

<style lang='scss' scoped>
.container{
  .btnBox{
    width: 8.14rem; 
    height: 1.07rem;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0px 3px 8px 0px rgba(204, 204, 204, 0.5);
    margin-bottom: 0.32rem;
    padding: 0.53rem;
  }
}
</style>

